# coding=utf-8
"""
author: jamon
hotfix_files中的文件在transceiver的handle_connected的时候就发送给客户端,需要特别
注意, 客户端连上服务端可能是首次连接, 也可能是断线重连, 这几种情况都要测试
"""
import os
from obespoir.share.espoir_log import global_log as logger

_reload_all = True


hotfix_files = [
    # "fix_client_example.py"
]
hotfix_code = {}


cur_dir = os.path.dirname(os.path.abspath(__file__))
for filename in hotfix_files:
    filepath = os.path.join(cur_dir, filename)
    if not os.path.exists(filepath):
        filepath = filepath + "c"
    with open(filepath, "r") as fp:
        content = fp.read()
        hotfix_code[filepath] = content


def __on_after_reload__():
    logger.info("[count=%s][files=%s]", len(hotfix_code), hotfix_code.keys())
